<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath}/css/login.css"
	rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/common.css"
	rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/header.css"
	rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
<script src="${pageContext.request.contextPath}/js/http.js"></script>
<script src="${pageContext.request.contextPath}/js/common.js"></script>
<title>登录</title>
</head>
<body>

	<script type="text/javascript">
		function userLoginFunction() {
			// 校验用户名:
			// 获得用户名文本框的值:
			var username = document.getElementById("username").value;
			if (username == null || username == '') {
				alert("用户名不能为空!");
				return false;
			}
			// 校验密码:
			// 获得密码框的值:
			var password = document.getElementById("password").value;
			if (password == null || password == '') {
				alert("密码不能为空!");
				return false;
			}

			var url = getUserLoginUrl();
			$.post(
		            url,
		            {
		            	userName: $("#username").val(),
		            	password: $("#password").val()
		            },
		            function (data, textStatus) {
		                if(textStatus=="success"){
		                	var code =data.code;
		                	var message = data.message;
		                	if(code=="1000"){
		                		toSubManagerPage();
		                	}else{
		                		alert("登录失败  "+message);
		                	}
		                }else{
		                	alert("登录 异常 ");
		                }
		            }, "json");

		}
	</script>


	<div class="main">
		<div class="div_content_main">

			<div class="div_content_main_2">
				<div class="div_username_1">
					<div class="div_username_2">用户名:</div>
					<div class="div_username_3">
						<input type="text" id="username" name="userName" class="text"
							maxlength="20" value="">
					</div>
				</div>
				<div class="div_password_1">
					<div class="div_password_2">密&nbsp;&nbsp;码:</div>
					<div class="div_password_3">
						<input type="password" id="password" name="password" class="text"
							maxlength="20" autocomplete="off">
					</div>
				</div>

				<div class="div_commit_mou">
					<div class="div_submit" id="div_submit"
						onclick="userLoginFunction()">登 录</div>

					<div class="div_to_register_page">
						<a
							href="${pageContext.request.contextPath}/user_registPage.action">注册</a>
					</div>
				</div>


			</div>
		</div>

	</div>



</body>
</html>